/*
 * launcher.cpp
 *
 *  Created on: Nov 7, 2013
 *      Author: m
 */

#include "DefinicionesComunes.h"
#include "ProcessAux.h"
#include "Cinta13A.h"
#include "Cinta13B.h"
#include "Cinta15.h"
#include "Robot11AProductor.h"
#include "Robot11BProductor.h"
#include "Robot14Consumidor.h"
#include "Robot14Productor.h"
#include "Robot16Consumidor.h"

using namespace ipc;

int main ( int argc, char* argv[] )
{
    CPrinter::setHeader( "LAUNCHER" );

    CPrinter::printOut("Creando los IPCs");
    Cinta13A::create();
    Cinta13B::create();
    Cinta15::create();
    Robot11AProductor::create();
    Robot11BProductor::create();
    Robot14Consumidor::create();
    Robot14Productor::create();
    Robot16Consumidor::create();

    CPrinter::printOut("Lanzando los procesos");

    std::string robot11APath = "./controlR11A";
    std::string robot11BPath = "./controlR11B";
    std::string robot14Path  = "./controlR14";
    std::string robot16Path  = "./controlR16";

    if ( argc > 1 )
    {
        ProcessAux::launchProcess( robot11APath );
        ProcessAux::launchProcess( robot11BPath );
        ProcessAux::launchProcess( robot14Path );
        ProcessAux::launchProcess( robot16Path );
    }

    return 0;
}
